import request from '@/config/axios'

// VIP免费下载记录 VO
export interface VipDownloadHistoryVO {
  id: number // 编号
  memberId: number // 会员ID
  memberName: string // 会员名称
  articleId: number // 文章ID
  articleName: string // 文章标题
  resourceId: number // 软件资源ID
  resourceName: string // 软件资源名称
}

// VIP免费下载记录 API
export const VipDownloadHistoryApi = {
  // 查询VIP免费下载记录分页
  getVipDownloadHistoryPage: async (params: any) => {
    return await request.get({ url: `/member/vip-download-history/page`, params })
  },

  // 查询VIP免费下载记录详情
  getVipDownloadHistory: async (id: number) => {
    return await request.get({ url: `/member/vip-download-history/get?id=` + id })
  },

  // 新增VIP免费下载记录
  createVipDownloadHistory: async (data: VipDownloadHistoryVO) => {
    return await request.post({ url: `/member/vip-download-history/create`, data })
  },

  // 修改VIP免费下载记录
  updateVipDownloadHistory: async (data: VipDownloadHistoryVO) => {
    return await request.put({ url: `/member/vip-download-history/update`, data })
  },

  // 删除VIP免费下载记录
  deleteVipDownloadHistory: async (id: number) => {
    return await request.delete({ url: `/member/vip-download-history/delete?id=` + id })
  },

  // 导出VIP免费下载记录 Excel
  exportVipDownloadHistory: async (params) => {
    return await request.download({ url: `/member/vip-download-history/export-excel`, params })
  }
}